﻿using System.Linq;

namespace dPet.Domain.Specifications
{
	using dPet.Domain.Models;
	using Hangerd.Specification;

	public class InventoryBatchSpecifications
	{
		public static Specification<InventoryBatch> HospitalIdEquals(string hospitalId)
		{
			return new DirectSpecification<InventoryBatch>(ib => ib.HospitalId == hospitalId);
		}

		public static Specification<InventoryBatch> DetailContainsProduct(Product product)
		{
			return new DirectSpecification<InventoryBatch>(ib => ib.Details.Count(d => d.ProductId == product.Id) > 0);
		}
	}
}
